home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / a-sequio.ads < prev    next >
Text File  |  1996-01-30  |  3KB  |  85 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                    A D A . S E Q U E N T I A L _ I O                     --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.5 $                              --
  10. --                                                                          --
  11. -- This specification is adapted from the Ada Reference Manual for use with --
  12. -- GNAT.  In accordance with the copyright of that document, you can freely --
  13. -- copy and modify this specification,  provided that if you redistribute a --
  14. -- modified version,  any changes that you have made are clearly indicated. --
  15. --                                                                          --
  16. ------------------------------------------------------------------------------
  17.  
  18.  
  19. with Ada.IO_Exceptions;
  20.  
  21. generic
  22.    type Element_Type (<>) is private;
  23.  
  24. package Ada.Sequential_IO is
  25.  
  26.    type File_Type is limited private;
  27.  
  28.    type File_Mode is (In_File, Out_File, Append_File);
  29.  
  30.    ---------------------
  31.    -- File management --
  32.    ---------------------
  33.  
  34.    procedure Create
  35.      (File : in out File_Type;
  36.       Mode : in File_Mode := Out_File;
  37.       Name : in String := "";
  38.       Form : in String := "");
  39.  
  40.    procedure Open
  41.      (File : in out File_Type;
  42.       Mode : in File_Mode;
  43.       Name : in String;
  44.       Form : in String := "");
  45.  
  46.    procedure Close  (File : in out File_Type);
  47.    procedure Delete (File : in out File_Type);
  48.    procedure Reset  (File : in out File_Type; Mode : in File_Mode);
  49.    procedure Reset  (File : in out File_Type);
  50.  
  51.    function Mode    (File : in File_Type) return File_Mode;
  52.    function Name    (File : in File_Type) return String;
  53.    function Form    (File : in File_Type) return String;
  54.  
  55.    function Is_Open (File : in File_Type) return Boolean;
  56.  
  57.    ---------------------------------
  58.    -- Input and output operations --
  59.    ---------------------------------
  60.  
  61.    procedure Read  (File : in File_Type; Item : out Element_Type);
  62.    procedure Write (File : in File_Type; Item : in Element_Type);
  63.  
  64.    function End_Of_File (File : in File_Type) return Boolean;
  65.  
  66.    ----------------
  67.    -- Exceptions --
  68.    ----------------
  69.  
  70.    Status_Error : exception renames IO_Exceptions.Status_Error;
  71.    Mode_Error   : exception renames IO_Exceptions.Mode_Error;
  72.    Name_Error   : exception renames IO_Exceptions.Name_Error;
  73.    Use_Error    : exception renames IO_Exceptions.Use_Error;
  74.    Device_Error : exception renames IO_Exceptions.Device_Error;
  75.    End_Error    : exception renames IO_Exceptions.End_Error;
  76.    Data_Error   : exception renames IO_Exceptions.Data_Error;
  77.  
  78. private
  79.  
  80.    type File_Control_Block;
  81.  
  82.    type File_Type is access File_Control_Block;
  83.  
  84. end Ada.Sequential_IO;
  85.